package source.model.technology;

import source.model.*;
import source.view.MainScreen;

public class UpgradeUnitSpeed extends UnitTechnology {

	private float amount;
	
	public UpgradeUnitSpeed(){
		this(.1f);
	}
	
	public UpgradeUnitSpeed(float amount){
		this(amount, (int)(Math.random()*100));
	}
	
	public UpgradeUnitSpeed(float amount, int research){
		this.amount=amount;
		setResearchTillDone(research);
	}
	
	public void teach(Player p) {
		p.modSpeedBonus(amount);
		MainScreen.writeToConsole("You have aquired a " + amount*10 + "% increase to Speed!");
	}
	
	public void research(int amount){
		decrementResearchTillDone(amount);
	}
	
	public String toString(){
		return "Unit Speed Upgrade";
	}
}
